Skip to content

refactor(storage): standardize ERC-7201 annotations and pin literals …#17

Merged
jayeshy14 merged 1 commit into
mainfrom
refactor/erc7201-storage-standardization
Jun 8, 2026
Merged

refactor(storage): standardize ERC-7201 annotations and pin literals …#17
jayeshy14 merged 1 commit into
mainfrom
refactor/erc7201-storage-standardization

Conversation

@jayeshy14
Copy link
Copy Markdown
Owner

…to namespaces

The nine namespaced storage modules documented their ERC-7201 location four different ways: the canonical @Custom:storage-location on the struct, an informal @dev erc7201: note on the constant, both at once, or neither. FeeStorage and the three strategy structs had no canonical annotation at all, so tooling that keys on @Custom:storage-location would not recognize them as namespaced.

Standardize on the canonical form: @Custom:storage-location erc7201: on the struct only, plus a uniform derivation comment above each precomputed slot constant. Slot values, constant names, struct names, and accessor names are unchanged, so there is no bytecode or call-site impact. LibDiamond keeps its canonical EIP-2535 keccak namespace and is intentionally left as is.

Add test/unit/StorageNamespaces.t.sol, which recomputes erc7201(namespace) for every module and asserts it equals the pasted literal, so a slot can never silently drift from its namespace string.

…to namespaces

The nine namespaced storage modules documented their ERC-7201 location four
different ways: the canonical @Custom:storage-location on the struct, an informal
@dev erc7201: note on the constant, both at once, or neither. FeeStorage and the
three strategy structs had no canonical annotation at all, so tooling that keys on
@Custom:storage-location would not recognize them as namespaced.

Standardize on the canonical form: @Custom:storage-location erc7201:<id> on the
struct only, plus a uniform derivation comment above each precomputed slot constant.
Slot values, constant names, struct names, and accessor names are unchanged, so
there is no bytecode or call-site impact. LibDiamond keeps its canonical EIP-2535
keccak namespace and is intentionally left as is.

Add test/unit/StorageNamespaces.t.sol, which recomputes erc7201(namespace) for every
module and asserts it equals the pasted literal, so a slot can never silently drift
from its namespace string.
@jayeshy14 jayeshy14 merged commit 60a5c75 into main Jun 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant